<?PHP
error_reporting(0);
ini_set('display_errors', '0');

if($_GET["debug"]){
	error_reporting(E_ALL);
	ini_set('display_errors', '1');
	echo dirname(__FILE__);
}

date_default_timezone_set ( "America/Mexico_City");

global $config,$root_path, $core,$user,$document;

$config=(object)array();

include_once 'config/defaults.config.php';
include_once 'config/paths.config.php';
include_once 'config/db.config.php';




if (!isset($_SESSION)) {
  session_start();
}

if($_SESSION["lang"]){
	$config->defaults["lang"]=$_SESSION["lang"];
	}

include_once $config->paths["core"]."pay_core.php";

$app=$_POST["app"]?$_POST["app"]:$_GET["app"];
$task=$_POST["task"]?$_POST["task"]:$_GET["task"];

$document=$core->getDocument("index.html");
switch($app){
  default:
    $handler=$core->getHandler($app);
	  if($handler){
	  	$handler->run($task);
	  }
	  else {
	    $result["error"]="2";
	    $result["errorDescription"]="Aplicacion Desconocida";
	  }
    break;
}


	$document->addStyle("css/estilo.css");
	$document->addScript("js/wait.js");

$document->out();

?>